<%@ page import="com.zueb.pojo.Page" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<script>
    function gotoPage(page){
        var form = document.getElementById("pageNumber");
        form.action="ProductServlet?action=searchPro&currentPage="+ page;
        form.submit();
    }
</script>
<form  method="post" id="pageNumber">
    <input type="hidden" name="totalPage" value="${totalPage}">
    <input type="hidden" name="orderfield" value="${orderField}">
    <input type="hidden" name="ordervalue" value="${orderValue}" >
    <input type="hidden" name="categoryid" value="${categoryid}">
    <input type="hidden" name="keyword" value="${keyword}">
    共找到${totalCount}条记录，当前第${currentPage}页，
    <%--首页--%>
    <a href="javascript:gotoPage('1')">首页</a>

    <%--上一页--%>
    <c:if test="${currentPage==1}">上一页</c:if>
    <c:if test="${currentPage!=1}">
        <a href="javascript:gotoPage('${currentPage-1}')">上一页</a>
    </c:if>

    <%--下一页--%>
    <c:if test="${currentPage>=totalPage}">下一页</c:if>
    <c:if test="${currentPage<totalPage}">
        <a href="javascript:gotoPage('${currentPage+1}')">下一页</a>
    </c:if>

    <%--尾页--%>
    <a href="javascript:gotoPage('${totalPage}')">尾页</a>
</form>